package com.magic233.entity;

/**
 * ClassName: OrderStatistical
 * Description:
 * date: 2021/6/2 15:12
 * author: zouyuan
 */
public class OrderStatistical implements Comparable {
    private Long timestamp;

    private String date;

    private String type;

    private Long acceptnum;

    private Long completenum;

    private String percentage;

    public Long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Long timestamp) {
        this.timestamp = timestamp;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Long getAcceptnum() {
        return acceptnum;
    }

    public void setAcceptnum(Long acceptnum) {
        this.acceptnum = acceptnum;
    }

    public Long getCompletenum() {
        return completenum;
    }

    public void setCompletenum(Long completenum) {
        this.completenum = completenum;
    }

    public String getPercentage() {
        return percentage;
    }

    public void setPercentage(String percentage) {
        this.percentage = percentage;
    }


    @Override
    public int compareTo(Object o) {
        if (o instanceof OrderStatistical) {
            OrderStatistical orderStatistical = (OrderStatistical) o;
            int compare = Double.compare(Double.parseDouble(this.percentage.split("%")[0]), Double.parseDouble(orderStatistical.percentage.split("%")[0]));
            return compare;
        }else {
            throw new RuntimeException("传入的数据类型不一致");
        }
    }
}
